Skip to content

FE-2028: Make Petrinaut's Actual Mode independent of what feeds it - #10121

Merged
kostandinang merged 4 commits into
mainfrom
kostandin/fe-2028-make-petrinauts-actual-mode-independent-of-what-feeds-it
Oct 21, 2026
Merged

kostandinang merged 4 commits into
mainfrom
kostandin/fe-2028-make-petrinauts-actual-mode-independent-of-what-feeds-it

Conversation

@kostandinang

@kostandinang kostandinang commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🌟 Purpose

Petrinaut's Actual Mode still names its only host. ActualModeSource is { kind: "brunch"; endpoint; runId? }, the shared context carries Brunch's raw SSE events so the Events tab can export them, and the docs and AI context describe Brunch. A flow run can't be a source without pretending to be Brunch.

This PR makes the interface generic without changing how Actual Mode works. The host still supplies the net, the initial marking and the transition firings, in the same shapes. Only the source changes, the raw stream export goes, and so does the website's Brunch Actual Mode route, which nothing produces a stream for any more.

🔍 Changes

  • ActualModeSource is now { id: string; label?: string }, and Petrinaut treats both as opaque. A new id starts a new timeline, and label is kept in recordings. The execution frame's sourceId is built from id.
  • receivedEvents leaves the shared context, along with the raw events recording type and helper.
  • The Events tab's Export Stream becomes Export Recording, and always downloads Petrinaut's recording: the net, its initial state and the firings. It used to save the raw SSE frames instead whenever the host passed them.
  • The recording version stays at 1. There are no older recordings to read, so the new source shape replaces the old one in place.
  • The website's /brunch route, its stream adapter in src/main/app/brunch-demo/, and the yarn brunch:fixture script are removed, with their README section and arch-docs mentions. The website's Brunch AI assistant is untouched.
  • The Actual Mode docs and the AI context description are written for any host.

⚠️ Known issues

🛡 Tests

  • Unit tests cover the new source in recordings, in the execution frame's sourceId, and in the Events tab.
  • Typecheck, lint and tests pass for @hashintel/petrinaut-core, @hashintel/petrinaut and @apps/petrinaut-website.
  • Searching libs/@hashintel/petrinaut and libs/@hashintel/petrinaut-core for brunch, sse and EventSource (any case) only finds AI assistant code and docs, brunchDemoMode and its tests, and an example plugin id in a comment.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Oct 21, 2026 7:44am UTC
petrinaut Ready Ready Preview Oct 21, 2026 7:44am UTC
petrinaut-docs Ready Ready Preview Oct 21, 2026 7:44am UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Oct 21, 2026 7:44am UTC

Request Review

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Breaking public Actual Mode types and exports, and removes the /brunch demo route hosts may have relied on for integration testing.

Overview
Actual Mode is no longer Brunch-shaped in core and UI. ActualModeSource becomes opaque { id; label? }, receivedEvents and raw SSE event recordings are removed from context and exports, execution sourceId keys off id, and the Events tab always offers Export Recording (normalized net + marking + firings) instead of Export Stream.

The petrinaut-website Brunch Actual Mode demo is deleted: /brunch, the brunch-demo stack (SSE provider, parsers, route), the brunch-sse-fixture script, and the brunch:fixture npm script. Example URL docs drop the /brunch baseline exception; arch docs no longer list Brunch as a streamed-definition reference route.

User-facing and core README/docs describe host-supplied execution generically rather than Brunch/SSE.

Reviewed by Cursor Bugbot for commit 4ec55b0. Bugbot is set up for automated code reviews on this repo. Configure here.

@kostandinang
kostandinang requested a review from lunelson October 20, 2026 15:36

@CiaranMn CiaranMn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main suggestion is to get rid of more code to cut down on future maintenance burden – any reason to keep the old-Brunch SSE stuff around in petrinaut-website?

Comment thread .changeset/host-agnostic-actual-mode.md Resolved
Comment thread apps/petrinaut-website/README.md Resolved
@kostandinang

Copy link
Copy Markdown
Contributor Author

My main suggestion is to get rid of more code to cut down on future maintenance burden – any reason to keep the old-Brunch SSE stuff around in petrinaut-website?

Kept it on purpose as a reference host for now, since it's the only way to try Actual Mode by hand until flow runs can be shown there (noted under Known issues in the description). Planned deleting in follow-up once that lands, but happy to delete it in this PR too.

…ding version 1

Co-authored-by: Cursor <cursoragent@cursor.com>
@kostandinang

Copy link
Copy Markdown
Contributor Author

Done in 4ec55b0: removed /brunch, the brunch-demo adapter and the fixture script

@kostandinang
kostandinang added this pull request to the merge queue Oct 21, 2026
@kostandinang kostandinang self-assigned this Oct 21, 2026
Merged via the queue into main with commit 3802e50 Oct 21, 2026
92 checks passed
@kostandinang
kostandinang deleted the kostandin/fe-2028-make-petrinauts-actual-mode-independent-of-what-feeds-it branch October 21, 2026 08:27

This branch was successfully deployed

3 active deployments
Preview – hash — 4ec55b04 Deployed Oct 21, 2026 by vercel[bot]
Preview – petrinaut-docs — 4ec55b04 Deployed Oct 21, 2026 by vercel[bot]
Preview – petrinaut — 4ec55b04 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

2 participants